<!--
 * @Description: 
 * @Version: 1.0
 * @Author: Will
 * @Date: 2021-12-06 14:15:37
 * @LastEditors: MarsLay 331412466@qq.com
 * @LastEditTime: 2024-02-21 10:17:25
 * @FilePath: \cloud-space\pages\assets\discern.vue
 * Copyright (C) 2021 Will. All rights reserved.
-->
<template>
  <l-page title="首页" headerBg="transparent">
    <view class="list">
      <image class="top-bg" mode="aspectFill" src="../../static/img/common/top-bg.png"></image>
      <z-paging ref="paging" v-model="list" @query="queryList">
        <view slot="top">
          <view class="part">
            <view @click="linkTo(v.url)" class="single-part" v-for="v in part" :key="v.id">
              <image class="part-icon" mode="aspectFill" :src="v.icon"></image>
              <view class="part-content">
                <view class="part-title">{{ v.title }}</view>
                <view class="part-tip">{{ v.tip }}</view>
              </view>
            </view>
          </view>
          <view class="middle-title">我的参与</view>
        </view>
        <view class="inner-list">
          <view class="single-content" v-for="v in list" :key="v.id">
            <view class="content-detail">
              <view class="content-inner">
                <view class="content-title single-ellipsis">{{ v.title }}</view>
                <view class="content-txt">{{ v.content }}</view>
              </view>
              <view class="content-user">
                <avatar shape="circle" :size="32" :src="v.headimg"></avatar>
                <view class="username">{{ v.username }}</view>
              </view>
            </view>
          </view>
        </view>
      </z-paging>
    </view>
  </l-page>
</template>

<script>
import avatar from "@/components/avatar/avatar";
export default {
  name: "index",
  components: { avatar },
  data() {
    return {
      screen: {
        limit: "",
        page: "",
      },
      part: [{ id: 0, title: '搜索', tip: '行程/创建者', icon: '../../static/img/icon/index-search.png', url: '/pages/global/search' },
      { id: 1, title: '邀请码', tip: '参与行程', icon: '../../static/img/icon/index-code.png' }],
      list: [{
        id: 0,
        title: '哈尔滨冰雪奇幻之旅',
        content: '行程描述行程描述行程描述行程描述行程描述行程描述行程描述行程描述行程描述行程描述行程描述行程描述行程描述',
        username: '玛卡巴卡',
        headimg: '',
        imgpath: []
      },]
    };
  },
  computed: {},
  watch: {},
  onLoad(d) { },
  onShow() { },
  methods: {
    queryList(pageNo, pageSize) {
      this.screen.page = pageNo;
      this.screen.limit = pageSize;
      this.getList();
    },
    getList() {
      this.$refs.paging.complete(this.list);
    },
    linkTo(url) {
      this.$util.linkTo(url);
    }
  },
  onUnload() { },
};
</script>
<style lang="less" scoped>
.list {

  background: linear-gradient(to bottom, transparent 20%, #ffffff 80%);

  .top-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 750upx;
    height: 622upx;
  }

  .part {
    .flex();
    padding: 38upx 30upx 30upx;

    .single-part {
      .flex(row, flex-start);
      padding: 24upx 34upx;
      width: 334upx;
      height: 140upx;
      background: #FFFFFF;
      box-shadow: 0 0 4upx 0 #E6E6E6;
      border-radius: 32upx;

      .part-icon {
        margin-right: 20upx;
        width: 92upx;
        height: 92upx;
      }

      .part-title {
        font-size: 28upx;
        font-weight: bold;
        color: #333333;
        line-height: 40upx;
      }

      .part-tip {
        margin-top: 4upx;
        font-size: 24upx;
        color: #999999;
        line-height: 34upx;
      }
    }
  }

  .middle-title {
    padding: 0 40upx 20upx;
    font-size: 28upx;
    font-weight: bold;
    color: #333333;
    line-height: 48upx;
  }

  .inner-list {
    padding: 0 20upx;

    .single-content {
      padding: 20upx 18upx 0 32upx;
      width: 100%;
      height: fit-content;
      background: #FFFFFF;
      box-shadow: 0 0 4upx 0 #E6E6E6;
      border-radius: 16upx;
      border: 2upx solid #00B578;

      .content-detail {
        .flex(row, space-between, flex-start);

        .content-inner {
          width: 532upx;
        }

        .content-user {
          .flex(column, center);
          width: calc(100% - 564upx);

          .username {
            margin-top: 4upx;
            font-size: 24upx;
            color: #666666;
            line-height: 48upx;
          }
        }

        .content-title {
          font-size: 32upx;
          font-weight: bold;
          color: #333333;
          line-height: 48upx;
        }

        .content-txt {
          margin: 10upx auto 20upx;
          font-size: 24upx;
          color: #DDDDDD;
          line-height: 48upx;
        }
      }
    }
  }
}
</style>